package edu.nf.llmtest.web;

import edu.nf.llmtest.common.VO.ResultVO;
import edu.nf.llmtest.common.base.BaseController;
import edu.nf.llmtest.service.impl.MailServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ Author bin
 * @ Create  2025/10/17 上午11:30
 **/
@RestController
@RequestMapping("/mail")
public class MailController extends BaseController {
    @Autowired
    private MailServiceImpl mailService;

    /**
     * 发送验证码
     * @param email 邮箱
     * */
    @GetMapping("/sendVerifyCode")
    public ResultVO sendVerifyCode(String email) {
        mailService.sendVerifyCode(email);
        return success();
    }

    /**
     * 验证码验证
     * @param email 邮箱
     * @param inputCode 输入的验证码
     * @return 验证结果
     * */
    @GetMapping("/verifyCode")
    public ResultVO verifyCode(String email, String inputCode) {
       return mailService.verifyCode(email, inputCode);
    }
}
